from django.http import HttpResponse

from iotutils.iothub import mqtt_init, mqtt_disconnect


# 初始化paho-mqtt,接收到的数据转存服务开启
def iot_init(request):
    mqtt_init()
    return HttpResponse("paho-mqtt初始化成功！")

def iot_disconnect(request):
    mqtt_disconnect()
    return HttpResponse("paho-mqtt断开连接！")